class StockPriceProvider

  def priceFor(stock)
    StockValue.new.price
  end

  def stockValueFor(stock)
    StockValue.new
  end

  def online?
    true
  end

end

class StockValue
  def getName
    "---"
  end
  def getPrice
    -1
  end
  def getDate
    Date.new
  end
end


require "stockpriceprovider/providers/bossapl.rb"

class StockPriceProviderFactory
  def self.getStockPriceProvider
    result = BossaPl.create
    if result.online?
      result
    else
      StockPriceProvider.new
    end
  end
end
